Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 7 - View-Related Objects / View-Related Objects Reference
View Port Functions / Measuring a Shape in Local Coordinates


GXGetShapeLocalBounds

You can use the GXGetShapeLocalBounds function to determine the bounding rectangle of a shape in local coordinates.

gxRectangle *GXGetShapeLocalBounds(gxShape source, 
                                    gxRectangle *bounds);
source
A reference to the shape whose bounding rectangle you wish to determine in local coordinates.
bounds
A pointer to a rectangle structure. On return, it contains the dimensions of the bounding rectangle.
function result
A rectangle that defines the bounds of the shape in local coordinates. (It is the same as the rectangle returned in the bounds parameter.)
DESCRIPTION
The GXGetShapeLocalBounds function returns the bounding rectangle of the source shape after the shape's transform mapping and style have been applied. The dimensions of the rectangle are in the shape's local coordinates. The rectangle pointed to by the bounds parameter also receives the bounding rectangle in local coordinates.

To determine a shape's bounding rectangle in geometry-space coordinates, use the GXGetShapeBounds function. To determine a shape's bounding rectangle in global coordinates, use the GXGetShapeGlobalBounds function. To determine a shape's bounding rectangle on a view device, use the GXGetShapeDeviceBounds function.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
shape_is_nil 
parameter_is_nil(debugging version)
SEE ALSO
For an example of the use of this function, see Listing 7-8 on page 7-51.

The GXGetShapeBounds function is described in the geometric operations chapter of Inside Macintosh: QuickDraw GX Graphics. The GXGetShapeGlobalBounds function is described on page 7-125. The GXGetShapeDeviceBounds function is described on page 7-116.

For information about coordinate spaces, see the section "About Drawing, Coordinate Conversion, and Clipping" beginning on page 7-30.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996